
package com.cse210.grocerwe.server;

import org.restlet.resource.ServerResource;
import com.cse210.grocerwe.common.*;
import com.cse210.grocerwe.client.*;
import javax.jdo.PersistenceManager;
import org.restlet.resource.Put;

public class APIResourceD extends ServerResource implements
APIInterfaceD
{
	PersistenceManager pm;
	

    @Put
    public void invite(SGroup group, String user)
    {
    	pm = PMF.get().getPersistenceManager();
    	GroupRequest gr = new GroupRequest(user.toLowerCase(),group.getCreator(),
    									   group.getName(),group.getKey());
    	
        try {
            pm.makePersistent(gr);
        } finally {
            pm.close();
        }
    }
    	

}
